<script type="text/javascript">
    $(document).ready(function (e) {
        var webNodeTree = $('.webNodeTree').jTree();
        webNodeTree.showAll(0);
        $('.webNodeTree .jentry').each(function (index, element) {
            var id = $(this).attr('id');
            if ($('.webNodeTree [pid=' + id + ']').length == 0 && $(this).attr('pid') != 0)
                $(this).find('.icon-close').show();
        });
    });
    function webNodeRemove(id) {
        LC.S.remove([{name: 'id', value: id}], LC.S.fleshTree);
    }
</script>
<div class="panel panel-default">
    <div class="panel-heading">栏目管理</div>
    <div class="panel-body webNodeTree">
        <div id="webNode_0" pid="">
            <span class="webNodeName" title="点击添加根栏目" onClick="LC.S.addChild('')">
                <span class="icon-libreoffice"></span>
                <span class="name">栏目管理</span>
            </span>
            <span class="icon-libreoffice" title="点击添加根栏目" onClick="LC.S.addChild('')"></span>
        </div>
    <#list webNodes as m>
        <div id="${m._id}" pid="${m.parentId!"webNode_0"}">
            <span class="webNodeName" title="${m.notes!"点击查看详情"}" onClick="LC.S.detail('${m._id}')">
                <span class="icon-libreoffice"></span>
                <span class="name">${m.name}</span>
                <span class="created">${m.created?date}</span>
            </span>
            <span class="icon-libreoffice" title="添加子栏目" onClick="LC.S.addChild('${m._id}')"></span>
            <span class="icon-close" title="删除栏目" onClick="webNodeRemove('${m._id}')"></span>
        </div>
    </#list>
    </div>
</div>